package com.w2cx.selenium.page;

import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.util.Locator;
import org.openqa.selenium.WebElement;

import java.util.List;

public class POI_CateManagePage extends BasePage {

   // DriverBase driver;
    public POI_CateManagePage(DriverBase driver){
        super(driver);
    }

    //获取“基础数据管理”菜单
    public WebElement getBaseDataManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("firstMenuList"));
        WebElement element = list.get(3);
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“POI分类管理”菜单
    public WebElement getPoiCategoryManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("BaseDataSecondMenu"));
        WebElement element = list.get(3);
        System.out.println("找到元素:"+element.getText());
        return element;
    }




    //获取“添加”按钮
    public WebElement getPoiAddBtn(){
        WebElement element = element(Locator.getByLocator("poiAddBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“分类名称”输入框
    public WebElement getPoiNameInput(){
        WebElement element = element(Locator.getByLocator("poiNameInput"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“保存”按钮
    public WebElement getPoiAddSaveBtn(){
        WebElement element = element(Locator.getByLocator("poiSaveBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取poi第一级别分类列表
    public List<WebElement> getPoiCateList(){
        List<WebElement> list = elements(Locator.getByLocator("poiCateList"));
        return list;
    }


    //获取要删除元素对应的删除按钮
    public WebElement getPoiDelBtn(WebElement Element){
        WebElement element = Element.findElement(Locator.getByLocator("poiDelBtn"));
        return element;
    }

    //获取删除确定按钮
    public WebElement getPoiDelConfirmBtn(){
        WebElement element = element(Locator.getByLocator("poiDelConfirmBtn"));
        return element;
    }


}
